package edu.hit.RESP;

public class BulkString implements RespData{

    private String  value;

    public BulkString(String value) {
        this.value = value;
    }

    @Override
    public Object getValue() {
        return this.value;
    }

    @Override
    public String convert() {
        if(this.value == null)
            return "$-1\r\n";
        return "$" + this.value.length() + "\r\n" + this.value + "\r\n";
    }

    @Override
    public String getType() {
        return "edu.hit.RESP.BulkString";
    }
}
